package com.t11.consumer.mapper;

import com.t11.common.pojo.LzwGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface GoodsMapper {


    @Select("select id, name, price, seckill_price, start_time from lzw_goods where id = #{goodsId}")
    LzwGoods findGoods(String goodsId);

    @Select("select stock from lzw_goods where id = #{goodsId}")
    Integer findStock(String goodsId);

    @Update("update lzw_goods set stock = stock - 1")
    void decrementStock();
}
